package com.yanxu.createthreads;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2024/7/21-2024
 * @Description: 继承 Thread 的方式创建线程
 */
public class ThreadStyle extends Thread{
    @Override
    public void run() {
        System.out.println("使用 Thread 的方式创建线程!!!");
        try {
            Thread.sleep(1000000000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) {
        ThreadStyle threadStyle = new ThreadStyle();
        threadStyle.setDaemon(true);
        threadStyle.start();
    }
}